package com.eight.statistics.controller;

import com.eight.common.vo.Result;
import com.eight.statistics.pojo.Course;
import com.eight.statistics.vo.TimeVo;
import com.eight.statistics.service.CourseService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @program: qy8-education
 * @description:
 * @author: 郑友民（1460115388@qq.com）
 * @create: 2023-05-27 20:32
 **/
@RestController
@RequestMapping("stat/course")
@Api(tags = "统计课程接口类")
public class CourseController {
    @Autowired
    private CourseService courseService;
    @PostMapping("queryAllCourseRanking")
    @ApiOperation("时间条件查询获取到课程")
    public Result queryAllCourseRanking(@RequestBody TimeVo timeVo){
       List<Course> courses = courseService.queryAllCourseRanking(timeVo);
        return Result.success(courses);
    }
}

